package com.toe.forum.webapi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.toe.pojo.entity.forum.ForumReply;
import com.toe.pojo.vo.forum.ReplyVO;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ForumReplyMapper extends BaseMapper<ForumReply> {
    /**
     * 利用mybatis-plus添加文章分类
     * @param forumCategory
     * int insert(ForumCategory forumCategory);
     * @return
     */


    /***
     * 根据 ID 删除
     * @param id 主键ID
     *  int deleteById(Serializable id);
     * */

    /**
     * 根据评论id删除回复
     * @param remarkId
     */
    void deleteByRemarkId(long remarkId);

    /**
     * 根据文章id删除回复
     * @param articleId
     */
    void deleteByArticleId(long articleId);

    /**
     * 查看此评论下面的回复
     * @param remarkId
     * @return
     */
    List<ReplyVO> selectReplyByRemarkId(long remarkId);

    /**
     * 查询一篇文章的回复数量
     * @param articleId
     * @return
     */
    int selectCountByArticleId(long articleId);
}
